package ex4;

public class TestLibrary {
	
	public static void main(String [] args){
		
		
		Book book1 = new Book("The Great Gatsby","F. Scott Fitzgerald");
		Book book2 = new Book("Harry Potter and the Sorcerer's Stone","J.K. Rowling");
		Book book3 = new Book("If You've Got It, Haunt It","Rose Pressey ");
		Book book4 = new Book("A Tapestry of Queens: A Story of Scotland's Struggle for Independence","Carol Milkuhn");
		Reader reader1 = new Reader("James ");
		Reader reader2 = new Reader("Jane ");
		Library lib = new Library();
		
		System.out.println("Library is empty");
		lib.printBooks();
		
		System.out.println("Library with books ");
		lib.addBook(book1);
		lib.addBook(book2);
		lib.addBook(book3);
		lib.addBook(book4);
		lib.printBooks();
	
		System.out.println("Library with books and readers");
		lib.addReader(reader1);
		lib.addReader(reader2);
		lib.printReaders();
		
		System.out.println("Readers take books ");
		reader1.takeBook(book1);
		reader1.takeBook(book2);
		reader1.takeBook(book3);
		reader2.takeBook(book4);
		
		System.out.println("Readers try to take not available books ");
		reader1.takeBook(book4);
		reader1.takeBook(book2);
		lib.printReaders();
		lib.printBooks();
	
		reader2.printBooks();
		reader1.printBooks();
		
		System.out.println("Readers return books ");
		reader1.returnBook(book1);
		reader2.returnBook(book4);
		
		reader2.printBooks();
		reader1.printBooks();
		lib.printBooks();
		lib.printReaders();
	}

}
